package openase.audiosearch.comm.response.encoder.facade;

import java.nio.ByteBuffer;

import openase.audiosearch.comm.response.Response;
import openase.audiosearch.comm.response.encoder.ResponseEncoder;
import openase.audiosearch.comm.response.encoder.factory.ResponseEncoderFactory;


public abstract class ResponseEncoderFacade {

	public static ByteBuffer encode(Response response) {
		ResponseEncoder<Response> encoder = ResponseEncoderFactory.getEncoder(response);
		if (encoder == null) {
			throw new IllegalArgumentException("No encoder found for response: " + response);
		}
		return encoder.encode(response);
	}

}
